package com.yaglyf.mvc.controller.auth;

import com.yaglyf.mvc.emun.Constant;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * Title: Class CommentsShow
 * Description:
 * 负责登入登出 cookies session
 * 数据清理
 *
 * @author qiang.yang
 * @version 1.0.0
 * @email qiang.yang@chinaredstar.com
 * @date: 2016/10/8 17:12
 */
@Controller
public class LogoutContrller {

    @RequestMapping(value = "logout",method = RequestMethod.GET)
    public String index(HttpServletRequest request){
        HttpSession session = request.getSession();
        session.removeAttribute(Constant.J_SESSION.name());
        return "redirect:login";
    }


}
